package com.bmw.seed.controller;

import com.bmw.seed.service.UserRegistInfoService;
import com.bmw.seed.util.bean.BaseResponse;
import com.bmw.seed.util.bean.RegisReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * Classname: UserController
 * Package: com.bmw.seed.controller
 * Description:
 *
 * @Author 王少伟
 * @Create 2024/1/29 14:03
 * @Version 1.8
 */
@RestController
@RequestMapping(value = "/user")
@Slf4j
public class UserController {
    @Autowired
    UserRegistInfoService userRegistInfoService;
    /**
     * 注册
     */
    @RequestMapping(value = "/regist")
    public BaseResponse<Boolean> regist(@Valid @RequestBody RegisReq req){
        return BaseResponse.ok(userRegistInfoService.regist(req));
    }
    @RequestMapping(value = "/unique")
    public BaseResponse<Boolean> unique(@Valid @RequestBody RegisReq req){
        return BaseResponse.ok(userRegistInfoService.unique(req));
    }
}
